/**
 * Nuxt 配置
 * @see https://nuxt.com/docs/api/configuration/nuxt-config
 */
export default defineNuxtConfig({
  compatibilityDate: "2025-07-03",
  devtools: { enabled: true }, // NuxtDev 调试工具
  srcDir: "src/", // 应用程序源目录
  app: {
    baseURL: "/nuxt/", // 应用程序基础路径
    head: {
      link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
    },
  },
  css: [
    "~/assets/css/main.css", // 引入 main.css
  ],
  components: [
    {
      path: "~/components", // components 目录下组件自动导入
      pathPrefix: false, // 只根据组件的名称而不是路径自动导入组件
    },
  ],
  devServer: {
    host: "0.0.0.0",
    port: 8066,
  },
  nitro: {
    devProxy: {
      "/api": {
        target: "https://md.abc.com.cn",
        changeOrigin: true,
      },
    },
  },
  modules: [
    "@nuxtjs/tailwindcss",
    "@element-plus/nuxt", // 引入 Element Plus
  ],
  elementPlus: {
    defaultLocale: "zh-cn", // 设置默认语言为中文
  },
});
